Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't run create_surfaces system if not needed #11720

Merged

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Feb 5, 2024

Objective

Solution

  • add a run condition so that the system won't run and block main if not needed

@mockersf mockersf added A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Performance A change motivated by improving speed, memory usage or compile times labels Feb 5, 2024
@alice-i-cecile alice-i-cecile added this to the 0.13 milestone Feb 5, 2024
Copy link
Contributor

@BorisBoutillier BorisBoutillier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked that the create_surfaces system is effectively only run once at the beginning, so will not blocked the rendering even in Reactive mode after initial setup.

Copy link
Contributor

@hymm hymm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool. I didn't realize that not running prepare_windows on the main thread would help with reactive low power mode + pipelined rendering. Makes sense to me after I thought abo ut it for a bit. The render thread is being told to run the last time, but is being blocked because it wants to run prepare windows on the main thread, but the main thread is asleep. We should be careful about this in the move NonSend resources PR.

@mockersf
Copy link
Member Author

mockersf commented Feb 5, 2024

Ah cool. I didn't realize that not running prepare_windows on the main thread would help with reactive low power mode + pipelined rendering. Makes sense to me after I thought abo ut it for a bit.

Yup it's a good surprise!

@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 5, 2024
@mockersf mockersf added this pull request to the merge queue Feb 5, 2024
Merged via the queue into bevyengine:main with commit e927756 Feb 5, 2024
28 checks passed
tjamaan pushed a commit to tjamaan/bevy that referenced this pull request Feb 6, 2024
# Objective

- Change set of systems as I made a mistake in bevyengine#11672 
- Don't block main when not needed
- Fixes bevyengine#11235 

## Solution

- add a run condition so that the system won't run and block main if not
needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Performance A change motivated by improving speed, memory usage or compile times S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button example is broken
4 participants